//
// Copyright 2018 Google Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions://
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

@import "./common";
@import "../packages/mdc-button/mdc-button";
@import "../packages/mdc-button/mixins";
@import "../packages/mdc-button/variables";
@import "../packages/mdc-card/mdc-card";
@import "../packages/mdc-card/variables";
@import "../packages/mdc-shape/mdc-shape";
@import "../packages/mdc-shape/mixins";

.demo-wrapper {
  margin: 24px;
}

// Demo buttons
// (TODO: padding, possibly through new button mixins)

.two-corner-container {
  @include mdc-shape-angled-corner($mdc-theme-background, $mdc-button-height / 4, 0);
}

.four-corner-container {
  margin: 0 8px;
  @include mdc-shape-angled-corner($mdc-theme-background, $mdc-button-height / 4 + 1);
}

.two-corner-container--outlined,
.four-corner-container--outlined {
  @include mdc-shape-angled-corner-outline(2px, $mdc-theme-primary);
}

.hero {
  // Override background mask color for buttons in hero section
  @include mdc-shape-angled-corner-background($hero-background-color);

  // For whatever reason, this aligns the shape borders better in Chrome on OS X,
  // as opposed to having the buttons centered side by side. Other browsers don't seem to have an issue.
  flex-direction: column;

  .four-corner-container {
    margin: 8px 0;
  }
}

// Demo card

.card-container {
  @include mdc-shape-angled-corner($mdc-theme-background, 24px, 4px);
  @include mdc-shape-angled-corner-outline($mdc-card-outline-width, $mdc-card-outline-color);
}

.demo-card {
  @include mdc-card-corner-radius(24px 4px);

  @include mdc-rtl {
    @include mdc-card-corner-radius(4px 24px);
  }
}

.demo-card__row {
  display: flex;
}

.demo-card__media {
  background-image: url("/images/1-1.jpg");
  width: 110px;
  border-top-left-radius: inherit;

  @include mdc-rtl {
    border-top-left-radius: 0;
    border-top-right-radius: inherit;
  }
}

.demo-card__info {
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
}
